package reader;

import java.io.InputStream;

import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

public class GetComment {
	public static void getComments(String url) throws Exception{
		//获取评论和点赞数
		HttpClient client = new DefaultHttpClient();
		String baseUlr = "http://mp.weixin.qq.com/mp/getcomment";
		String getCommentURL= url.replace("http://mp.weixin.qq.com/s", baseUlr);
		HttpGet get = new HttpGet(getCommentURL);
		HttpResponse httpResponse = client.execute(get);
		InputStream inputStream = httpResponse.getEntity().getContent();
		System.out.println(IOUtils.toString(inputStream));
	}
}
